<template>
	<view class="content">
		<view class="list">
			<view class="list_item">
				<view class=" d-f j-b">
					<view class="c1a f16 f-w d-f">
						{{details.title}} <text class="f12 cfd labels">{{details.jsfs}}</text>
					</view>
					<view class="f16 cfd f-w">
						{{details.xzfw}}
					</view>
				</view>
				<view v-if="details.gzfl_tab" class="c76 f12 label_list">
					<label v-for="items in details.gzfl_tab" class="lable">{{items}}</label>
				</view>
				<view class="c76 f12 d-f j-b publisher">
					<view class=" d-f">
						<image class="filter" src="/static/filter.png" alt="" />
						<text>{{details.ygdw}}</text>
					</view>
					<view class="">
						{{details.area_name}}
					</view>
				</view>
				<view class="d-f j-b but f-w">
					<view class="c1a f14">
						招聘人数：{{details.gwrs}}人
					</view>
<!-- 					<view class="cff f14 t-c">
						报名
					</view> -->
				</view>
			</view>
		</view>
		<view class="c1a f-w f16 title">
			职位要求
		</view>
		<view class="list_item">
			<view class="c1a f14 f-w">
				岗位职责
			</view>
			<view class="c3d f12 mt-10">
				{{details.gwzz}}
			</view>
			<view class="c1a f14 f-w mt-10">
				任职资格
			</view>
			<view class="c3d f12 mt-10">
				{{details.rzzg}}
			</view>
		</view>
		<view class="buts cff t-c f14" @click="registration(details.id)">
			报名
		</view>
	</view>
</template>

<script>
	import unis from '@/utils/util.js'
	export default {
		data() {
			return {
				details:[]
			}
		},
		onLoad(e) {
			console.log(e)
			var that = this
			unis.getData('/api/job/'+e.id, 'get', {
				
			}, function (res) {
				if(res.code == 200){
					that.details = res.data
				}
			});
		},
		methods: {
			registration(e){
				var that = this
				unis.getData('/api/job/'+e+'/sign_up', 'POST', {
					
				}, function (res) {
					if(res.code == 200){
						uni.showToast({
						  title: '报名成功，等待企业审核。',
						  icon: 'none',
						  duration: 2000
						});
						setTimeout(() => {
							uni.navigateTo({
								url:'/pages/registration/registration'
							})
						}, 2000)
					}
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
.content{
	background: #F9FAFB;
	height: 100vh;
}
.list{
	padding-top: 10px;
}
.list_item{
	margin: 10px 16px;
	padding: 13px 17px;
	background: #FFFFFF;
	border-radius: 4px 4px 4px 4px;
	.labels{
		background: rgba(253,75,55,0.1);
		padding: 2px 5px;
		margin-left: 4px;
	}
	.label_list{
		margin-top: 9px;
		.lable{
			padding: 2px 4px;
			background: #F0F0F0;
			border-radius: 4px 4px 4px 4px;
			margin-right: 5px;
		}
	}
	.publisher{
		margin-top: 13px;
		.filter{
			width: 13px;
			height: 13px;
			margin-right: 3px;
		}
	}
	.but{
		border-top: 1px solid #D8D8D8;
		margin-top: 11px;
		padding-top: 9px;
		.cff{
			width: 54px;
			height: 24px;
			background: #2D73FF;
			border-radius: 4px 4px 4px 4px;
			line-height: 24px;
		}
	}
}
.title{
	margin: 10px 16px;
}
.buts{
	margin:94px 16px 10px 16px;
	height: 45px;
	background: linear-gradient( 270deg, #36A2FC 0%, #2D73FF 100%);
	border-radius: 4px 4px 4px 4px;
	line-height: 45px;
}
</style>
